Developer Documentation
PATH  Mac OS X Documentation > Developer Tools > Mac OS X Assembler Guide


Previous | Contents | Next

Directives for Moving the Location Counter

This section describes directives that advance the location counter to a location higher in memory. They have the additional effect of setting the intervening memory to some value.

.align

SYNOPSIS

.align expression [ ,fill_expression ]

The .align directive advances the location counter to the next expression boundary, if it isn't currently on such a boundary. expression is a power of 2 between 0 and 15 (not the result of the power of 2; for example, the argument of . align 3 means 2 to the third). The fill expression, if specified, must be absolute. The space between the current value of the location counter and the desired value is filled with the low-order byte of the fill expression (or with zeros, if fill_expression isn't specified).

The assembler enforces no alignment for any bytes created in the object file (data or machine instructions). You must supply the desired alignment before any directive or instruction.

EXAMPLE:

.align 3 one: .double 0r1.0

.org

SYNOPSIS

.org expression [ ,fill_expression ]

The .org directive sets the location counter to expression , which must be a currently known absolute expression. This directive can only move the location counter up in address. The fill expression, if specified, must be absolute. The space between the current value of the location counter and the desired value is filled with the low-order byte of the fill expression (or with zeros, if fill_expression isn't specified).

If the output file is later link-edited, the .org directive isn't preserved.

EXAMPLE

.org 0x100,0xff

Mac OS X Assembler Guide: ASM Directives

Previous | Contents | Next